
<div id="agentUpdate">
    <form id="frmUpdatePlayer" class="clear" action="" method="POST">
        <h1 class="title-big-01"><?=$LANG["label"]["CHANGEINFORMATION"];?></h1><br/>
        <div class="clear group-table-2">
            <div class="table-management-2">

                <div class="row head clear">
                    <span><?=$LANG["label"]["ACCOUNTDETAIL"];?></span>
                </div>
                <div class="row clear">
                    <span class="col caption"><?=$LANG["label"]["USERNAME"];?> </span>
                    <span class="col">
                        <input type="text" name="login" value="<?= $arr['Username']; ?>" />
                        <div class="notification"></div>
                    </span>
                </div>
                <div class="row clear">
                    <span class="col caption"><?=$LANG["label"]["PASSWORD"];?> </span>
                    <span class="col">
                        <input type="text" name="password" value="" />
                        <div class="notification"></div>
                    </span>
                </div>
                <div class="row clear">
                    <span class="col caption"><?=$LANG["label"]["ISLOCKED"];?> ? </span>
                    <span class="col">
                        <div class="checkbox">
                            <input type="checkbox" name="isLocked" <?= ($arr['IsLocked'] == 'Y') ? 'checked' : ''; ?> value="<?= $arr['IsLocked']; ?>"/>
                        </div>
                    </span>
                </div>
            </div>
            <div class="table-management-2">

                <div class="row head clear">
                    <span><?=$LANG["label"]["PERSONALINFORMATION"];?></span>
                </div>
                <div class="row clear">
                    <span class="col caption"><?=$LANG["label"]["FIRSTNAME"];?> </span>
                    <span class="col">
                        <input type="text" name="firstname" value="<?= $arr['FirstName']; ?>" />
                        <div class="notification"></div>
                    </span>
                </div>
                <div class="row clear">
                    <span class="col caption"><?=$LANG["label"]["LASTNAME"];?></span>
                    <span class="col">
                        <input type="text" name="lastname" value="<?= $arr['LastName']; ?>" />
                        <div class="notification"></div>
                    </span>
                </div>
                <div class="row clear">
                    <span class="col caption"><?=$LANG["label"]["GENDER"];?></span>
                    <span class="col">
                        <div class="radio">
                            <input  type="radio" <?= ($arr['Gender'] == '1') ? 'checked' : '' ?>  value="1" name="gender"> 
                            <span><?=$LANG["label"]["MALE"];?></span>
                        </div>
                        <div class="radio">
                            <input type="radio" <?= ($arr['Gender'] == '0') ? 'checked' : '' ?>  value="0" name="gender"> 
                            <span><?=$LANG["label"]["FEMALE"];?></span>
                        </div>
                    </span>
                </div>
                <div class="row clear">
                    <span class="col caption"><?=$LANG["label"]["EMAIL"];?></span>
                    <span class="col">
                        <input type="email" name="email" value="<?= $arr['Email'] ?>" />
                        <div class="notification"></div>
                    </span>
                </div>
            </div>
        </div>
        <div class="row-group-submit-tbm2 clear">
            <input type="hidden" name="playerID" value="<?= $arr['PlayerID'] ?>"/>
            <input type="button" name="updateuser" value="<?=$LANG["label"]["CHANGE"];?>" />
            <input type="reset" name="back" value="<?=$LANG["label"]["BACK"];?>" onclick="goBack();" />
        </div>
    </form>
</div>


<script>
    handleCheckedBox();
    var url = URL_LODE + '/View/agent-management-taikhoan.php';

    //Update Player
    $('#frmUpdatePlayer input[name="updateuser"]').click(function() {
        $.ajax({
            url: url,
            type: 'POST',
            beforeSend: function() {
                mb.createloadingTable1('#contentManagement > .overlay-loading');
            },
            data: {
                tab: "listofuser",
                action: 'updateuser',
                playerid: $('#frmUpdatePlayer input[name="playerID"]').val(),
                username: $('#frmUpdatePlayer input[name="login"]').val(),
                password: $('#frmUpdatePlayer input[name="password"]').val(),
                islocked: $('#frmUpdatePlayer input[name="isLocked"]').is(":checked") ? "Y" : "N",
                firstname: $('#frmUpdatePlayer input[name="firstname"]').val(),
                lastname: $('#frmUpdatePlayer input[name="lastname"]').val(),
                gender: $('#frmUpdatePlayer input[name="gender"]:checked').val(),
                email: $('#frmUpdatePlayer input[name="email"]').val()
            },
            success: function(data) {
                if (parseInt(data) === 1)
                    openDialogMessage("Thông Báo", "Thay đổi thành công !");
                else
                    openDialogMessage("Thông Báo", "Thay đổi thất bại !");
            },
            complete: function() {
                mb.destroyloadingTable1();
            }
        });
    });
</script>
